package com.gap.donot;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RadioButton;
import android.widget.TextView;

public class SelectActivity extends Activity {
	static boolean ispvp = false;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_select);
		ispvp = false;
		TextView textView = (TextView) findViewById(R.id.textView6);
		TextView textView1 = (TextView) findViewById(R.id.textView7);
		TextView textView2 = (TextView) findViewById(R.id.textView8);
		TextView textView3 = (TextView) findViewById(R.id.textView9);
		TextView textView4 = (TextView) findViewById(R.id.learn);
		final RadioButton radioButton1 = (RadioButton) findViewById(R.id.RadioButton1);
		final RadioButton radioButton2 = (RadioButton) findViewById(R.id.RadioButton2);
		OnClickListener onClickListener = new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(SelectActivity.this,
						MainActivity.class);
				switch (v.getId()) {
				case R.id.textView6:
					intent.putExtra("size", 6);
					startActivity(intent);
					break;
				case R.id.textView7:
					intent.putExtra("size", 7);
					startActivity(intent);
					break;
				case R.id.textView8:
					intent.putExtra("size", 8);
					startActivity(intent);
					break;
				case R.id.textView9:
					intent.putExtra("size", 9);
					startActivity(intent);
					break;
				case R.id.RadioButton2:
					ispvp = true;
					if (radioButton1.isChecked()) {
						radioButton1.setChecked(false);
					}
					break;
				case R.id.RadioButton1:
					ispvp = false;
					if (radioButton2.isChecked()) {
						radioButton2.setChecked(false);
					}
					break;
				case R.id.learn:
					Intent intent2 = new Intent(getApplicationContext(),
							LeadActivity.class);
					startActivity(intent2);
					finish();
					break;
				default:
					break;
				}
			}
		};
		textView4.setOnClickListener(onClickListener);
		radioButton1.setOnClickListener(onClickListener);
		radioButton2.setOnClickListener(onClickListener);
		textView.setOnClickListener(onClickListener);
		textView1.setOnClickListener(onClickListener);
		textView2.setOnClickListener(onClickListener);
		textView3.setOnClickListener(onClickListener);
	}

}
